Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding aspects and annotations #1128

Merged
merged 2 commits into from
Nov 6, 2021

Conversation

paulpdaniels
Copy link
Collaborator

Unifies the Wrapper capabilities into a higher-level abstraction of GraphQLAspect the idea being that many of the existing specification capabilities require changes not just to the execution of the request but also to the underlying schema (adding directives, manipulating the underlying graphql).
As a demonstration I refactored the federate function into a wrapper (though still kept the existing function for backward compatibility).

@ghostdogpr
Copy link
Owner

This is nice!

Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some minor comments.

@@ -9,6 +9,7 @@ import caliban.wrappers.Wrapper.CombinedWrapper
import caliban.{ CalibanError, GraphQLRequest, GraphQLResponse, ResponseValue }
import zio.{ UIO, ZIO }
import zio.query.ZQuery
import caliban.{ GraphQL, GraphQLAspect }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: sort imports

* A symbolic alias for `withWrapper`.
*/
final def @@[R2 <: R](wrapper: Wrapper[R2]): GraphQL[R2] = withWrapper(wrapper)
final def @@[LowerR <: UpperR, UpperR <: R](aspect: GraphQLAspect[LowerR, UpperR]): GraphQL[UpperR] =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some scaladoc here and in GraphQLAspect?

@ghostdogpr ghostdogpr merged commit a2748a0 into ghostdogpr:master Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants